# file:: command_entity.rb
# author::  Ralph M. Churchill
# version::
# date::
#
# This source code copyright (C) 2006 by Ralph M. Churchill
# All rights reserved.
#
# Released under the terms of the GNU General Public License
# See LICENSE file for additional information.

module CanExecuteCommands
    attr_reader :commands

    def find_command(name)
        @commands ||= []
        @commands.find{|cmd| cmd.name == name}
    end
    def add_command(command)
        @commands ||= []
        @commands << command unless find_command(command.name)
    end
    def del_command(command)
        @commands ||= []
        @commands.delete_if{|cmd| cmd.name == command.name}
    end
end
